package com.sfjc.FirstTask.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sfjc.FirstTask.entity.User;
import com.sfjc.FirstTask.mapper.UserMapper;
import com.sfjc.FirstTask.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService {

    @Override
    public List<User> getUserList() {
        return baseMapper.selectList(null);
    }

    @Override
    public User getUserById(Integer userId) {
        return baseMapper.selectById(userId);
    }

    @Override
    public void deleteUserById(Integer userId) {
        baseMapper.deleteById(userId);
    }

    @Override
    public void updateUser(User user) {
        baseMapper.updateById(user);
    }

    @Override
    public void addUser(User user) {
        baseMapper.insert(user);
    }
}
